package ihm_clarifiee.sauvegarde;

import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

public class CareTaker<T> {

	protected List<Memento<T>> mementos;
	
	public CareTaker(){
		mementos = new LinkedList<Memento<T>>();
		
		Set<Memento<T>> s = new HashSet<Memento<T>>();
	}
	
	public void addMemento(Memento<T> m){
		mementos.add(m);
	}
	
	public void removeMemento(Memento<T> m){
		mementos.remove(m);
	}
	
	public Memento<T> getMemento(int index){
		assert mementos.size() > index;
		return mementos.get(index);
	}
	
	public List<Memento<T>> getMementoList(){
		return mementos;
	}
	
}
